import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-01-24
 * Time: 16:31
 */
public class Test {
    public static void fun(int[] array){
        for (int i = 0; i < array.length; i++) {
            int minDex=i;
            for (int j = i+1; j <array.length ; j++) {
                if(array[j]<array[minDex]){
                    minDex=j;
                }
            }
            swap(array,i,minDex);
        }

    }
    private static void swap(int[] arr,int i,int j){
        int tmp=arr[i];
        arr[i]=arr[j];
        arr[j]=tmp;
    }
    public static void main(String[] args) {
        int[]  arrays ={3,5,7,10,4};
        fun(arrays);
        System.out.println(Arrays.toString(arrays));

    }
}
